<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登录</title>
    <link rel="shortcut icon" href="favicon.ico"> <link href="__CSS__/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__CSS__/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="__CSS__/animate.css" rel="stylesheet">
    <link href="__CSS__/style.css?v=4.1.0" rel="stylesheet">
    <link href="__PLUGINS__/css/toastr/toastr.min.css" rel="stylesheet">
    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->
    <script>if(window.top !== window.self){ window.top.location = window.location;}</script>
</head>
<body class="gray-bg">
<div class="middle-box text-center loginscreen  animated fadeInDown">
    <div>
        <div><h3 class="logo-name">GW</h3></div>
        <h3>欢迎使用 {:config('admin.title')}</h3>
        <form class="m-t" role="form" action="{:url('login')}" method="post">
            <div class="form-group">
                <input type="text" name="name" class="form-control" placeholder="用户名" required="">
            </div>
            <div class="form-group">
                <input type="password" name="password" class="form-control" placeholder="密码" required="">
            </div>
            <div class="form-group">
                <input type="text" name="captcha" class="form-control" placeholder="验证码" required style="width: 65%;display: inline-block;float: left;">
                <div style="display: inline-block;float: left;height: 41px;">
                    <img src="{:captcha_src()}" alt="captcha" style="height: 80%;" onclick="this.src=this.src + '?' + Math.random()"/>
                </div>
            </div>
            <button type="submit" class="btn btn-primary block full-width m-b">登 录</button>
            <!--<p class="text-muted text-center">
                <a href="login.html#"><small>忘记密码了？</small></a> | <a href="register.html">注册一个新账号</a>
            </p>-->
        </form>
    </div>
</div>

<!-- 全局js -->
<script src="__JS__/jquery.min.js?v=2.1.4"></script>
<script src="__JS__/bootstrap.min.js?v=3.3.6"></script>
<script src="__JS__/jquery.form.js"></script>
<script src="__PLUGINS__/js/toastr/toastr.min.js"></script>
</body>
</html>
<script>
    toastr.options = {
        positionClass: "toast-top-center",
        showDuration: "300",
        hideDuration: "1000",
        timeOut: "2000",
        extendedTimeOut: "1000",
    };
    $('form').ajaxForm(function(response) {
        if (!response.code) {
            toastr.warning(response.msg)
        } else {
            toastr.success(response.msg)
            setTimeout(function(){
                window.location.href = response.url
            }, response.wait * 1000);
        }
    });
</script>
